<%@ include file="/common/taglibs.jsp"%>
<%@taglib prefix="customer" tagdir="/WEB-INF/tags/customer" %>
<probiz:pageHeading pageHeadingKey="membershipList.title" />
<content tag="buttons">
	<probiz:iconBtn btnType="add" onclick="return fnDoAdd(this);" />
	<probiz:iconBtn btnType="delete" onclick="return fnDoMultiDelete(this);" />
</content>
<%@include file="include/membershipListTipInfo.jspf" %>
<form class="mainForm" name="membershipForm" method="post" action="membership.html">
	<div class="data">
		<div class="top clearfix">
			<ul class="tab">
				<li class="curr"><span><fmt:message key="menu.membershipList"/></span></li>
			</ul>
			<%@include file="/common/pagingOnlyTop.jsp"%>
		</div>
		<c:set var="checkAll">
			<input type="checkbox" name="allbox" onclick="checkAll(this.form)" class="checkbox" />
		</c:set>
		<display:table name="${membershipList}" cellspacing="0" cellpadding="0"	uid="membership" class="list_table"  requestURI="" >
			<display:column class="checkbox_column" title="${checkAll}" headerClass="data-table-title" media="html"> 
				<c:if test="${!membership.baseMembership}">
			    	<input type="checkbox" name="multiIds" title="${membership.membershipName}" value="${membership.membershipId}" class="checkbox" />
			    </c:if>
			</display:column>
		   
		    <display:column headerClass="data-table-title"  sortable="true" decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="membership.membershipName">
	        	<a href="${ctxPath}/customer/membership.html?doAction=edit&from=list&membershipId=${membership.membershipId}">
		        	${membership.membershipName}
		        </a>
		        <c:if test="${membership.baseMembership}">
		        	(<fmt:message key="membership.default"/>)
		        </c:if>
			</display:column>
		
		    <display:column property="membershipLevel"  headerClass="data-table-title"  sortable="true"
		        decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="membership.membershipLevel"/>
		    
		     <display:column property="upgradeShopPoint"  headerClass="data-table-title" sortable="true"
		        decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="membership.upgradeShopPoint"/>
		    
		    <display:column  headerClass="data-table-title"  maxLength="64" style="width: 50%"
		        decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="membership.membershipDetail">
				${membership.membershipDetail}
			</display:column>
			<authorize:authorizeResource resourceString="/customer/customer*">
				<display:column headerClass="data-table-title" decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="common.action">
		        	<span class="view"></span><a href="javaScript:onclick=showUsers('${membership.membershipId}');"><fmt:message key="membershipList.viewUsers"/>(<customer:customerCounts membershipId="${membership.membershipId}"/>)</a>
			    </display:column>
			</authorize:authorizeResource>
		</display:table>
		<%@include file="/common/paging.jsp"%>
	</div>
</form>
<br/>
<form id="showUserForm" name="showUserForm" action="${ctxPath}/customer/customer.html" method="post">
	<input type="hidden" name="COL@s.membership.membershipId@Integer@EQ" id="COL@s.membershipId@Integer@EQ" value=""/>
	<input name="btnSearch" size="15" type="hidden"  id="btnSearch"  value="true">
</form>
<script type="text/javascript">
$j(document).ready(function () {
	highlightTableRows("membership");
});
function showUsers(membershipId){
	window.location = __ctxPath+'/customer/customer.html?membershipId='+membershipId;
}
</script>

